<html>
<head>
  <title>batchjs</title>
  <style>
  body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #654;
    color: #f0f0f0;
    font: 75% "Consolas", monospace;
  }
  html {
    margin: 0;
    padding: 0;
    min-height: 100%;
  }
  textarea {
    border: 0;
    padding: 5px;
    width: 50%;
    height: 50%;
    margin: 0;
    font: 100% "Consolas", monospace;
    resize: none;
  }
  #input {
    float: left;
    color: #403a30;
    background: #fed;
  }
  #output {
    clear: left;
    float: left;
    color: #d03030;
    background: #edc;
    cursor: default;
  }
  #ast {
    float: right;
    color: #f0f0f0;
    background: #543;
    cursor: default;
    height: 100%;
  }
  </style>
</head>
<body>
<textarea id="ast"></textarea>
<textarea id="input">
batch(let db : connection) {
  print("Sold out products:");
  
  db.Products.forEach(function(product) {
    if( product.UnitsInStock == 0 )
      print( product.ProductName + " is sold out");
  });
}
</textarea>
<!--
  print("Sold out products:");

  db.Products.forEach(function(product) {
    if( product.UnitsInStock == 0 )
      print( product.ProductName + " is sold out");
  });

  /* let p = {};
  p.Name = "New Widget";
  p.UnitPrice = 23.23;
  db.Products.insert(p); */
-->
<textarea id="output"></textarea>

<script data-main="batchjs" src="require.js"></script>

</body>
</html>